/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.web30.bookmark;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 * @author xiazy
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "bookmark"
})
@XmlRootElement(name = "bookmarks")
public class Bookmarks {

    @XmlElement(required = true)
    protected List<Bookmark> bookmark;

    public List<Bookmark> getBookmark() {
        if(bookmark == null) {
            bookmark = new ArrayList<Bookmark>();
        }
        return bookmark;
    }

    public void setBookmark(List<Bookmark> bookmark) {
        this.bookmark = bookmark;
    }

    @Override
    public String toString() {
        return (this.bookmark != null) ? "{\"bookmark\": " + this.bookmark.toString() + "}" : "{bookmark:[]}";
    }

}
